<template>
  <svg aria-hidden="true" :style="style" class="t-icon">
    <use :xlink:href="'#icon-' + name"></use>
  </svg>
</template>
<script>
export default {
  name: "TIcon",
  props: {
    name: String,
    size: {
      type: String,
      default: "1em"
    }
  },
  computed: {
    style() {
      const style = { overflow: "hidden" };
      if (this.size) {
        style.height = this.size;
        style.width = this.size;
      }
      return style;
    }
  }
};
</script>
